#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMovie>
#include <QTextToSpeech>    //语音播放
#include <QDebug>   //包含调试输出
#include <QTcpSocket.h> //TcpSocket连接

#include "device/device_ac.h"   //空调
#include "device/device_lamp.h" //灯
#include "device/device_music.h" //音乐
//#include "device/device_tv.h" //电视
#include "voice/audio.h"
#include "voice/controller.h"


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QString IP,QWidget *parent = 0);
    ~MainWindow();
    QString hostAddress;

private slots:
    void slot_timeout(void);
    void update_background(bool);
    void update_foreground(bool);

    void log_message(QString);  // 输出日志

    void on_DeviceAC_clicked();
    void on_DeviceLamp_clicked();
    void on_DeviceMusic_clicked();

    void on_liyankang_pressed();
    void on_liyankang_released();

    void on_DeviceTV_clicked();

private:
    Ui::MainWindow *ui;

    QTcpSocket *tcpsocket;//声明了一个名为tcpsocket的指向QTcpsocket类型的指针

    QMovie* voice_movie;
    QMovie* music_movie;

    DeviceAC* wid_DeviceAC;
    DeviceLamp* wid_DeviceLamp;
    DeviceMusic* wid_DeviceMusic;
//    DeviceTV *wid_DeviceTV;

    Audio *audio;
    QTextToSpeech my_speaker;
    Controller *controller;
    QTimer* my_timer;

};

#endif // MAINWINDOW_H
